package com.ruoyi.base.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.base.mapper.InventoryMapper;
import com.ruoyi.base.domain.Inventory;
import com.ruoyi.base.service.IInventoryService;

/**
 * 库存信息Service业务层处理
 *
 * @author wonderland
 * @date 2023-07-16
 */
@Service
public class InventoryServiceImpl implements IInventoryService {
    @Autowired
    private InventoryMapper inventoryMapper;

    /**
     * 查询库存信息
     *
     * @param id 库存信息主键
     * @return 库存信息
     */
    @Override
    public Inventory selectInventoryById(Long id) {
        return inventoryMapper.selectInventoryById(id);
    }

    /**
     * 查询库存信息列表
     *
     * @param inventory 库存信息
     * @return 库存信息
     */
    @Override
    public List<Inventory> selectInventoryList(Inventory inventory) {
        return inventoryMapper.selectInventoryList(inventory);
    }

    /**
     * 新增库存信息
     *
     * @param inventory 库存信息
     * @return 结果
     */
    @Override
    public int insertInventory(Inventory inventory) {
        return inventoryMapper.insertInventory(inventory);
    }

    /**
     * 修改库存信息
     *
     * @param inventory 库存信息
     * @return 结果
     */
    @Override
    public int updateInventory(Inventory inventory) {
        return inventoryMapper.updateInventory(inventory);
    }

    /**
     * 批量删除库存信息
     *
     * @param ids 需要删除的库存信息主键
     * @return 结果
     */
    @Override
    public int deleteInventoryByIds(Long[] ids) {
        return inventoryMapper.deleteInventoryByIds(ids);
    }

    /**
     * 删除库存信息信息
     *
     * @param id 库存信息主键
     * @return 结果
     */
    @Override
    public int deleteInventoryById(Long id) {
        return inventoryMapper.deleteInventoryById(id);
    }

    @Override
    public Inventory getByBarCode(String code) {
        return inventoryMapper.getByBarCode(code);
    }
}
